export type ConstructInputGroupType = {
	placeholder: string;
	disabled: boolean;
	maxlength?: number;
	/** 代表是否为原始项 原始项不可删除 */
	raw: boolean;
	/** 默认值 */
	value: string;
};

export const constructInput = (
	option: Partial<ConstructInputGroupType>,
	minLen: number = 1
): ConstructInputGroupType[] => {
	const { placeholder = "", disabled = false, raw = false, value = "" } = option;

	return Array.from({ length: minLen }, () => ({
		placeholder,
		disabled,
		raw,
		value,
	}));
};
